Skip to content

fix: remove hardcoded /bin/sh for external editor on Windows#246

Open
jiang1997 wants to merge 1 commit into
MoonshotAI:mainfrom
jiang1997:fix/external-editor-windows-shell
Open

fix: remove hardcoded /bin/sh for external editor on Windows#246
jiang1997 wants to merge 1 commit into
MoonshotAI:mainfrom
jiang1997:fix/external-editor-windows-shell

Conversation

@jiang1997
Copy link
Copy Markdown

Related Issue

Resolve #238

Problem

Ctrl+G opens the configured external editor by spawning /bin/sh -c "<editor> <tempfile>". This fails on Windows because /bin/sh is not available, so Windows users cannot use the external editor flow.

What changed

Run the external editor command through Node's platform shell instead of spawning /bin/sh directly. Quote the appended temp file path per platform so paths with spaces survive shell parsing.

This preserves existing shell-style editor commands such as code --wait and nvim +set ft=markdown, while allowing Windows to use its platform shell for the external editor flow.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

Run the external editor through Node's platform shell instead of spawning
/bin/sh directly. Quote the appended temp file path per platform so Ctrl+G
works on Windows while preserving shell-style editor commands.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 30, 2026

🦋 Changeset detected

Latest commit: b499459

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

windows平台Ctrl+g快捷键无法使用

1 participant